package com.lhnstart.learn.bases.cycle;

/**
 * for 循环demo
 *
 * @author lhn
 * @date 2022/10/25 11:11
 * @since 1.0.0
 **/
public class For {

    public static void main(String[] args) {
        extracted();
    }

    private static void extracted1() {
        for (int i = 0, j = 5; i <= 5; i++, j--) {
            System.out.println(i + "+" + j + "=" + (i + j));
        }
    }

    private static void extracted() {
        int sumNumber = 0;
        int countNumber = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 9 == 0) {
                countNumber += 1;
                sumNumber += i;
            }
        }
        System.out.println(sumNumber + ":" + countNumber);
    }

}